﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@ViewBag.Title</title>
    <link href="/Admin/plugins/layui/css/layui.css" rel="stylesheet" />
    <link href="/Admin/Content/fonts/iconfont.css" rel="stylesheet" />
    <link href="/Admin/Content/css/admin.css" rel="stylesheet" />
    <script src="/Admin/plugins/layui/layui.js"></script>
    <script src="/Admin/Content/js/global.js"></script>
    <style type="text/css">
        body {
            margin: 10px;
        }
    </style>
</head>
<body>
    <script type="text/javascript">
        layui.config({
            base: '/Admin/plugins/app/',
            version: '1522709297490' //为了更新 js 缓存，可忽略
        });
    </script>
    @RenderBody()
    <script type="text/javascript">
        layui.use(['common'], function () {
            var $ = layui.jquery;
            common = layui.common;
        })
        //关闭页面
        function CloseWin() {
            parent.location.reload(); // 父页面刷新
            //var _btnSearch = window.parent.document.getElementById("btnSearch");  这里注释是因为菜单管理没有搜索按钮
            //if (_btnSearch) {
            //    _btnSearch.click();
            ////}
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
        }
        //监听表单提交
        function submitForm(form, msg) {
            layui.use(['common'], function () {
                var $ = layui.jquery;
                common = layui.common;
                form.on('submit(submitForm)', function (data) {
                    ajaxSubmitForm($("#form"), function (data) {
                        if (data.state == "success") {
                            common.msgSuccess(msg);
                            setTimeout(CloseWin, 1500);
                        }
                    });
                    return false;
                });
            })
        }
    </script>
</body>
</html>
